var express = require('express');
var app = express();
var http = require('http');
//创建一个服务器
var server = http.createServer(app);
//监听端口
var port = '3000';
server.listen(port);

//服务器端引入socket.io
var io = require('socket.io').listen(server);
io.on('connection', function(socket){
  socket.on('message', function () { });
  socket.on('disconnect', function(){  });
});